package com.axzhengxin.platform.afterloan.service.impl;

import com.axzhengxin.platform.afterloan.domain.FspCorInf;
import com.axzhengxin.platform.afterloan.mapper.FspCorInfMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * CommonWarningTaskServiceImpl
 * 贷后预警定时任务实现
 *
 * @author jiangnan
 * @date 2021/3/8
 */
@Slf4j
@Service("commonWarningTask")
public class CommonWarningTaskServiceImpl extends AbstractWarningTaskService {

    @Autowired
    private FspCorInfMapper fspCorInfMapper;

    @Override
    public void exec() {
        // 读取所有关联有未结清贷款，且已经上传有征信授权书的客户
        List<FspCorInf> fspCorInfList = fspCorInfMapper.selectFspCorInfWithUnfinishedLoan();
        log.info("本次执行共有{}户企业需要调用贷后预警服务", fspCorInfList.size());
        // 分页以降低内存压力（主要是授权书内容）
//        pageList(fspCorInfList).forEach(this::exec);
        exec(fspCorInfList);
    }



}
